import React, { FC, useRef } from 'react'
import { Dialog, List, SwipeAction, Toast } from 'antd-mobile'


export default () => {
    return (
        <>
            <WithList />
        </>
    )
}

// 配合列表使用
const WithList: FC = () => {

    const items = ['A', 'B', 'C']
    return (
        <List>
            {items.map(item => (
                <SwipeAction
                    key={item}
                    leftActions={ [
                        {
                            key: 'pin',
                            text: '置顶',
                            color: 'primary',
                            onClick:  (event) => {

                                console.log(item)
                            }
                        }
                    ]}
                    rightActions={[

                        {
                            key: 'delete',
                            text: '删除',
                            color: 'danger',
                            onClick:  (event) => {

                                console.log(item)
                            }
                        },
                    ]}
                >
                    <List.Item>{item}</List.Item>
                </SwipeAction>
            ))}
        </List>
    )
}



